package com.tuanzi.loan.web.lazy.extratemplate;

import com.tuanzi.loan.business.service.extratemplate.ExtraTemplateService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.extratemplate.ExtraTemplateRequest;
import com.tuanzi.loan.vo.response.extratemplate.ExtraTemplateResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author caiwanlin
 * @create 2018-10-16 14:55
 */
public class ExtraTemplateLazyDataModel extends LazyDataSessionModel<ExtraTemplateRequest,ExtraTemplateResponse> {

    private ExtraTemplateService extraTemplateService;

    public ExtraTemplateLazyDataModel(ExtraTemplateRequest extraTemplateRequest, CurrentUserBean session, ExtraTemplateService extraTemplateService) {
        super(extraTemplateRequest, session);
        this.extraTemplateService = extraTemplateService;
    }

    @Override
    protected Page<ExtraTemplateResponse> doLoad0(PageSearcher<ExtraTemplateRequest> pageSearcher) {
        return extraTemplateService.list(pageSearcher);
    }
}